package principle.singleResponsibility;

/**
 * @author shkstart
 * @create ${year}-${month}-${day}-${time}
 */
public class singleResponsibility {
    public static void main(String[] args) {

    }
}
//方案二遵守单一职责原则
//但是改动太大，修改了客户端和分解了类
//解决方案，直接改进原先的类，改动的比较少
class loadVehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在公路上运行");
    }
}
class airVehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在天空上运行");
    }
}
class waterVehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在水里上运行");
    }
}